package cn.com.code.hwjs;

import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;
import java.util.Scanner;

/**
 * 四则运算
 *
 * @author zhengpei
 * https://www.nowcoder.com/practice/9999764a61484d819056f807d2a91f1e?tpId=37&tqId=21273&rp=1&ru=/exam/oj&qru=/exam/oj&sourceUrl=%2Fexam%2Foj%3Fdifficulty%3D3%26page%3D1%26pageSize%3D50%26search%3D%26tab%3D%25E5%2590%258D%25E4%25BC%2581%25E7%25AC%2594%25E8%25AF%2595%25E7%259C%259F%25E9%25A2%2598%26topicId%3D37&difficulty=3&judgeStatus=undefined&tags=&title=
 * @date 2022/5/2
 */
public class HwJs50 {

  public static void main(String[] args) throws ScriptException {
    Scanner sc = new Scanner(System.in);
    String str = sc.nextLine();
    str = str.replace("[", "(");
    str = str.replace("]", ")");
    str = str.replace("{", "(");
    str = str.replace("}", ")");
    ScriptEngine scriptEngine = new ScriptEngineManager().getEngineByName("JavaScript");
    System.out.println(scriptEngine.eval(str));
  }

}
